import request from '@/utils/request'

////////////// 账号相关 /////////////////////
export function getWxAccountList(params) {
  return request({
    url: process.env.WECHAT_API + '/manage/wxAccount/list',
    method: 'get',
    params
  })
}

export function addWxAccount(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxAccount/save',
        method: 'post',
        data: params
    })
}


export function deleteWxAccount(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxAccount/delete',
        method: 'post',
        data: params
    })
}


////////////// 获取粉丝相关 /////////////////////
export function getWxUserList(params) {
  return request({
    url: process.env.WECHAT_API + '/manage/wxUser/list',
    method: 'get',
    params
  })
}

export function deleteWxUser(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxUser/delete',
        method: 'post',
        data: params
    })
}

export function syncWxUsers(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxUser/syncWxUsers',
        method: 'post',
        data: params
    })
}

////////////// 获取标签相关 //////////////
export function getWxUserTags(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxUserTags/list',
        method: 'get',
        params
    })
}

export function deleteWxUserTags(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxUserTags/delete/' + params,
        method: 'post'
    })
}

export function saveWxUserTags(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxUserTags/save',
        method: 'post',
        data: params
    })
}

////////////// 获取消息相关 //////////////
export function getWxMsgList(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxMsg/list',
        method: 'get',
        params
    })
}

export function deleteWxMsg(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxMsg/delete/' + params,
        method: 'post'
    })
}

export function saveWxMsg(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxMsg/save',
        method: 'post',
        data: params
    })
}


////////////// 自动规则回复相关 //////////////
export function getWxMsgReplyRules(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/msgReplyRule/list',
        method: 'get',
        params
    })
}

export function getWxMsgReplyRuleInfo(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/msgReplyRule/info/' + params,
        method: 'get'
    })
}

export function insertOrUpdateMsgReplyRule(option, params) {
    return request({
        url: process.env.WECHAT_API + '/manage/msgReplyRule/' + option,
        method: 'post',
        data: params
    })
}

export function deleteWxMsgReplyRules(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/msgReplyRule/delete',
        method: 'post',
        data: params
    })
}


////////////// 菜单相关 //////////////
export function getWxMenu(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxMenu/getMenu',
        method: 'get',
        params
    })
}

export function editWxMenu(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxMenu/updateMenu',
        method: 'post',
        data: params
    })
}

////////////// 素材相关 //////////////
export function getWxAssets(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxAssets/materialFileBatchGet',
        method: 'get',
        params
    })
}

export function getWxAssetsCount(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxAssets/materialCount',
        method: 'get',
        params
    })
}

export function getNewsWxAssets(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxAssets/materialNewsBatchGet',
        method: 'get',
        params
    })
}

export function deleteWxAssets(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxAssets/materialDelete',
        method: 'post',
        data: params
    })
}


////////////// 带参二维码相关 //////////////
export function getWxQrCodeList(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxQrCode/list',
        method: 'get',
        params
    })
}

export function addWxQrCode(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxQrCode/createTicket',
        method: 'post',
        data: params
    })
}

export function deleteWxQrCode(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/wxQrCode/delete',
        method: 'post',
        data: params
    })
}

////////////// 模板相关 //////////////
export function getWxMsgTemplate(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/msgTemplate/list',
        method: 'get',
        params
    })
}

export function deleteWxMsgTemplate(params) {
    return request({
        url: process.env.WECHAT_API + 'manage/msgTemplate/delete',
        method: 'post',
        data: params
    })
}

export function syncWxMsgTemplate(params) {
    return request({
        url: process.env.WECHAT_API + '/manage/msgTemplate/syncWxTemplate',
        method: 'post',
        data: params
    })
}

